package xiao_jin.fantastic_journey.client.model;

import net.minecraft.data.client.Model;
import net.minecraft.data.client.TextureKey;
import xiao_jin.fantastic_journey.util.ModUtil;

import java.util.Optional;

public class ModModels {
    public static final Model BROADSWORD = ModModels.item("broadsword", TextureKey.LAYER0);
    public static final Model RAPIER = ModModels.item("rapier", TextureKey.LAYER0);
    public static final Model LONGSWORD = ModModels.item("longsword", TextureKey.LAYER0);

    private static Model make(TextureKey... requiredTextureKeys) {
        return new Model(Optional.empty(), Optional.empty(), requiredTextureKeys);
    }

    private static Model block(String parent, TextureKey... requiredTextureKeys) {
        return new Model(Optional.of(ModUtil.getIdOfMod("block/" + parent)), Optional.empty(), requiredTextureKeys);
    }

    private static Model item(String parent, TextureKey... requiredTextureKeys) {
        return new Model(Optional.of(ModUtil.getIdOfMod("item/" + parent)), Optional.empty(), requiredTextureKeys);
    }

    private static Model block(String parent, String variant, TextureKey... requiredTextureKeys) {
        return new Model(Optional.of(ModUtil.getIdOfMod("block/" + parent)), Optional.of(variant), requiredTextureKeys);
    }
}
